package o;

import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.graphics.Outline;
import android.graphics.PorterDuff.Mode;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableContainer;
import android.graphics.drawable.GradientDrawable;
import android.graphics.drawable.InsetDrawable;
import android.graphics.drawable.RippleDrawable;
import android.os.Build.VERSION;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.RequiresApi;
import java.lang.reflect.Method;

@RequiresApi(21)
class gm extends ge {
    private static Method ˊ;

    gm(Drawable drawable) {
        super(drawable);
        ॱ();
    }

    gm(gl glVar, Resources resources) {
        super(glVar, resources);
        ॱ();
    }

    public void setHotspot(float f, float f2) {
        this.ˎ.setHotspot(f, f2);
    }

    public void setHotspotBounds(int i, int i2, int i3, int i4) {
        this.ˎ.setHotspotBounds(i, i2, i3, i4);
    }

    public void getOutline(@NonNull Outline outline) {
        this.ˎ.getOutline(outline);
    }

    @NonNull
    public Rect getDirtyBounds() {
        return this.ˎ.getDirtyBounds();
    }

    public void setTintList(ColorStateList colorStateList) {
        if (ˎ()) {
            super.setTintList(colorStateList);
        } else {
            this.ˎ.setTintList(colorStateList);
        }
    }

    public void setTint(int i) {
        if (ˎ()) {
            super.setTint(i);
        } else {
            this.ˎ.setTint(i);
        }
    }

    public void setTintMode(Mode mode) {
        if (ˎ()) {
            super.setTintMode(mode);
        } else {
            this.ˎ.setTintMode(mode);
        }
    }

    public boolean setState(@NonNull int[] iArr) {
        if (!super.setState(iArr)) {
            return false;
        }
        invalidateSelf();
        return true;
    }

    protected boolean ˎ() {
        if (VERSION.SDK_INT != 21) {
            return false;
        }
        Drawable drawable = this.ˎ;
        if ((drawable instanceof GradientDrawable) || (drawable instanceof DrawableContainer) || (drawable instanceof InsetDrawable) || (drawable instanceof RippleDrawable)) {
            return true;
        }
        return false;
    }

    public boolean isProjected() {
        if (!(this.ˎ == null || ˊ == null)) {
            try {
                return ((Boolean) ˊ.invoke(this.ˎ, new Object[0])).booleanValue();
            } catch (Throwable e) {
                Log.w("WrappedDrawableApi21", "Error calling Drawable#isProjected() method", e);
            }
        }
        return false;
    }

    private void ॱ() {
        if (ˊ == null) {
            try {
                ˊ = Drawable.class.getDeclaredMethod("isProjected", new Class[0]);
            } catch (Throwable e) {
                Log.w("WrappedDrawableApi21", "Failed to retrieve Drawable#isProjected() method", e);
            }
        }
    }
}
